export type SRResponse<D = any> = {
  code?: number;
  msg?: string;
  data?: D;

  ok?: boolean;
};

export type SRListResponse<D = any> = SRResponse<
  SRPage & {
    list: D[];
    total?: number;
  }
>;

export type SRPage = {
  pageNum?: number;
  pageSize?: number;
};

// 列表数据响应
export type PListRes<D = any> = SRListResponse<D>;

// 数据响应
export type PDataRes<D = any> = SRResponse<D>;
export type PromiseRes<D = any> = Promise<PDataRes<D>>;
export type PromiseListRes<D = any> = Promise<PListRes<D>>;
export type BaseResponse<D = any> = Promise<{ ok?: boolean } & D>;
